﻿<UserControl x:Class="Mnk.TBox.Plugins.DevServerRunner.Settings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.DevServerRunner.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WPFControls"
             xmlns:Settings="clr-namespace:Mnk.TBox.Plugins.DevServerRunner.Code.Settings"
             xmlns:captioned1="clr-namespace:Mnk.Library.WpfControls.Components.Captioned;assembly=Mnk.Library.WPFControls"
             xmlns:filesAndFolders="clr-namespace:Mnk.Library.WpfControls.Components.FilesAndFolders;assembly=Mnk.Library.WPFControls"
             xmlns:components="clr-namespace:Mnk.Library.WpfControls.Components;assembly=Mnk.Library.WPFControls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <TabControl>
        <TabItem Header="{loc:Tr ConfigureProjectsDirectories}">
            <Units:CheckableListBoxUnit Name="Dirs" ItemsSource="{Binding ServerInfos}" UnitType="FolderPath" Title="{loc:Tr SelectProjectFolder}" SmoothScrolling="True" >
                <Units:CheckableListBoxUnit.ItemTemplate>
                    <DataTemplate DataType="Settings:ServerInfo">
                        <StackPanel Margin="0,10">
                            <DockPanel>
                                <components:ExtCheckBox IsChecked="{Binding IsChecked}" VerticalAlignment="Center" DockPanel.Dock="Left" Padding="5,0" ValueChanged="CheckBoxChecked" />
                                <filesAndFolders:EditPath Value="{Binding Key}" Padding="0" FontWeight="Bold" IsEnabled="{Binding IsChecked}" PathGetterType="Folder"/>
                            </DockPanel>
                            <DockPanel>
                                <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Orientation="Horizontal" Margin="5">
                                    <CheckBox IsChecked="{Binding AdminPrivilegies}" IsEnabled="{Binding IsChecked}"/>
                                    <TextBlock Text="{loc:Tr RunAsAdmin}" />
                                </StackPanel>
                                <captioned1:CaptionedNumericUpDown Caption="{loc:Tr Port}" Value="{Binding Port}" DockPanel.Dock="Left" IsEnabled="{Binding IsChecked}"/>
                                <captioned1:CaptionedTextBox Caption="{loc:Tr VirtualPath}" Value="{Binding VPath}" IsEnabled="{Binding IsChecked}"/>
                            </DockPanel>
                        </StackPanel>
                    </DataTemplate>
                </Units:CheckableListBoxUnit.ItemTemplate>
            </Units:CheckableListBoxUnit>
        </TabItem>
        <TabItem Header="{loc:Tr Advanced}">
            <StackPanel>
                <captioned1:CaptionedEditPath Caption="{loc:Tr PathToDevServer}" Value="{Binding PathToDevServer}" PathGetterType="File" Margin="5" PathGetterFilter="{loc:Tr ExecutableFileMasks}"/>
                <StackPanel>
                    <CheckBox Content="{loc:Tr RunBrowser}" IsChecked="{Binding RunBrowser}" Name="RunBrowser" Margin="5,5,0,0" />
                    <captioned1:CaptionedEditPath Caption="{loc:Tr PathToBrowser}" Value="{Binding PathToBrowser}" PathGetterType="File" Margin="5" IsEnabled="{Binding ElementName=RunBrowser, Path=IsChecked}" PathGetterFilter="{loc:Tr ExecutableFileMasks}"/>
                </StackPanel>
            </StackPanel>
        </TabItem>
    </TabControl>
</UserControl>
